#define _CRT_SECURE_NO_WARNINGS 1

#include"Date.h"

//int main()
//{
//	Date d1(1000, 1, 1);
//	Date d2(1001, 2, 1);
//
//	cout << d1 - d2 << endl;
//	
//	return 0;
//}

int main() {
    char newd[10];
    scanf("%s", newd);
    int year = (*newd - '0') * 1000 + (*(newd + 1) - '0') * 100 + (*
        (newd + 2) - '0') * 10 + (*(newd + 3) - '0');
    int month = (*(newd + 4) - '0') * 10 + (*(newd + 5) - '0');
    int day = (*(newd + 6) - '0') * 10 + (*(newd + 7) - '0');

    Date d1(year, month, day);
    scanf("%s", newd);
    year = (*newd - '0') * 1000 + (*(newd + 1) - '0') * 100 + (*
        (newd + 2) - '0') * 10 + (*(newd + 3) - '0');
    month = (*(newd + 4) - '0') * 10 + (*(newd + 5) - '0');
    day = (*(newd + 6) - '0') * 10 + (*(newd + 7) - '0');
    Date d2(year, month, day);

    cout << d1 - d2 << endl;

    return 0;
}